
/**************** define print uart ******************/
#define PRINT_UART                       USART1
#define PRINT_UART_CRM_CLK               CRM_USART1_PERIPH_CLOCK
#define PRINT_UART_TX_PIN                GPIO_PINS_9
#define PRINT_UART_RX_PIN                GPIO_PINS_10

#define PRINT_UART_TX_GPIO               GPIOA
#define PRINT_UART_TX_GPIO_CRM_CLK       CRM_GPIOA_PERIPH_CLOCK


#define COUNTOF(a)                       (sizeof(a) / sizeof(*(a)))
#define USART1_TX_BUFFER_SIZE            256
#define USART1_RX_BUFFER_SIZE            256


/******************* define button *******************/

#define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)

extern uint8_t usart1_tx_buffer[] ;
extern uint8_t usart1_rx_buffer[USART1_TX_BUFFER_SIZE];
extern volatile uint8_t usart1_tx_counter;
extern volatile uint8_t usart1_rx_counter;
extern uint8_t usart1_tx_buffer_size ;
extern uint8_t usart1_rx_buffer_size ;


void uart_init(uint32_t baudrate);



